
package com.jy.wms.web;

import com.jy.wms.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/*
* 货品管理
* 路由页面
* */
@Controller
@RequestMapping("/goods")
public class WmsGoodsRouter {
    //主页面
//    @RequestMapping(value = "/toCkrb")
//    public String toCkrb() {
//        return "ckrb/ckrb";
//    }
    @Autowired
    SysMenuService menuService;

    //主页面
    @RequestMapping(value = "/getgoods/{menu}")
    public String getgoods(@PathVariable("menu") String menu, Model model) {
        model.addAttribute("functions",menuService.getFunctions(menu));
        return "goods/goodsList";
    }
    // 新增页面
    @RequestMapping(value = "/toGoodAdd")
    public String toGoodAdd() {
        System.out.println("222222222222");
        return "goods/goodsAdd";
    }
    // 新增页面
    @RequestMapping(value = "/toGoodEdit")
    public String toGoodEdit(String id, Model model) {
        System.out.println("222222222222");
        model.addAttribute("id",id);
        return "goods/goodsEdit";
    }
//    @RequestMapping(value = "toGoodAdd")
//    public String toGoodAdd(Model model, HttpSession session){
//        return  "goods/goodsAdd";
//    }
}
